﻿using System.Text;
using Shinkansen.Support;
using Yahoo.Yui.Compressor;

namespace Shinkansen.Crunchers
{
    public class YahooCssCruncher : ICssCruncher
    {
        /// <summary>
        /// Gets crunched content.
        /// </summary>
        /// <param name="content">The content.</param>
        /// <returns></returns>
        public byte[] Process (byte[] content)
        {
            string plainContent = Encoding.UTF8.GetString (content);
            string crunchedContent = CssCompressor.Compress (plainContent);

            return Encoding.UTF8.GetBytes (crunchedContent);
        }
    }
}
